package com.allwees.bs.module.oms.service;

import com.allwees.bs.core.model.constant.CacheName;
import com.allwees.bs.module.oms.req.query.OmsOrderQueryReq;
import com.allwees.bs.module.oms.vo.OrderWithStatVo;
import org.springframework.cache.annotation.Cacheable;

import java.math.BigDecimal;
import java.util.List;

public interface OrderStatisticsService {

    @Cacheable(cacheNames = CacheName.AB_ORDER_STATISTICS_WAIT_PAY_COUNT, key = "#req.getRetailerUuid() != null ?#req.getRetailerUuid() : 'admin'")
    Integer findWaitPayCount(OmsOrderQueryReq req);

    @Cacheable(cacheNames = CacheName.AB_ORDER_STATISTICS_WAIT_SHIP_COUNT, key = "#req.getRetailerUuid() != null ?#req.getRetailerUuid() : 'admin'")
    Integer findWaitShipCount(OmsOrderQueryReq req);

    @Cacheable(cacheNames = CacheName.AB_ORDER_STATISTICS_WAIT_REVIEW_COUNT, key = "#req.getRetailerUuid() != null ?#req.getRetailerUuid() : 'admin'")
    Integer findWaitReviewCount(OmsOrderQueryReq req);

    @Cacheable(cacheNames = CacheName.AB_ORDER_STATISTICS_REFUNDED_COUNT, key = "#req.getRetailerUuid() != null ?#req.getRetailerUuid() : 'admin'")
    Integer findRefundedCount(OmsOrderQueryReq req);

    @Cacheable(cacheNames = CacheName.AB_ORDER_STATISTICS_YESTERDAY_DEAL_AMT, key = "#req.getRetailerUuid() != null ?#req.getRetailerUuid() : 'admin'")
    BigDecimal findYesterdayDealAmt(OmsOrderQueryReq req);

    @Cacheable(cacheNames = CacheName.AB_ORDER_STATISTICS_TODAY_DEAL_AMT, key = "#req.getRetailerUuid() != null ?#req.getRetailerUuid() : 'admin'")
    BigDecimal findTodayDealAmt(OmsOrderQueryReq req);

    @Cacheable(cacheNames = CacheName.AB_ORDER_STATISTICS_TOTAL_DEAL_AMT, key = "#req.getRetailerUuid() != null ?#req.getRetailerUuid() : 'admin'")
    BigDecimal findTotalDealAmt(OmsOrderQueryReq req);

    @Cacheable(cacheNames = CacheName.AB_ORDER_STATISTICS_REFUNDED_DEAL_AMT, key = "#req.getRetailerUuid() != null ?#req.getRetailerUuid() : 'admin'")
    BigDecimal findRefundedDealAmt(OmsOrderQueryReq req);

    List<OrderWithStatVo> findWithStat(OmsOrderQueryReq req);
}
